<div class="container">
    <!-- <div data-google-ad=""/> -->

    <h1>Configuring file sets</h1>
    <p>In the <a href="#!/project-setup">getting started section</a> we configured our project using the simple
        configuration approach. <br/> With the simple configuration all files in your project get checked by the same
        check configuration.</p>
    <p><img src="images/properties_simple_checked.png" alt="Checkstyle Properties Page"/>
        <br/> Using the simple project configuration might suite you in most cases there are cases where you might need
        more control:</p>
    <ol>
        <li>
            <p>You only want to check certain files based on the file name or exclude files based on the file name</p>
        </li>
        <li>
            <p>You want to check parts of your project with one check configuration and another part of your project
                with another check configuration</p>
        </li>
    </ol>
    <p>To give you fine grained control over which files get checked with which check configuration the plug-in allows
        you to configure file sets. <br/> A File Set is a collection of files within one project that need to be checked
        with the same Check Configuration. A File Set is defined using regular expressions to select the files to
        include and exclude from the File Set.</p>
    <p>Deselect the check box <i>Use simple configuration</i> on the upper right of the Checkstyle Properties Page.</p>
    <p><img src="images/properties_advanced.png" alt="Checkstyle Properties Page advanced"/>
        <br/> Now a table is displayed containing all file sets configured for this project. <br/> There is already a
        default file set named <i>all</i> in the table. <br/>
        <br/>
        <br/>
    </p>
    <p>To create a new file set click the <i>Add...</i> button, to edit an existing file set select the file set in
        question and use the <i>Edit...</i> button: <br/> Both actions will result in the Checkstyle File Set Editor
        opening.</p>
    <p><img src="images/file_set_editor.png" alt="Checkstyle File Set Editor"/>
        <br/> Each File Set is given a unique name and a Check Configuration. Select from the drop down list the Check
        Configuration you want used when this File Set is audited. <br/> If no Check Configurations appear in the drop
        down list then you will need to first create one. See <a href="basic_creating_config.html">Creating a Check
            Configuration</a> for information on how to create a Check Configuration.</p>
    <p>Next, enter a series of <a href="advanced_regularexpressions.html">regular expressions</a> to select which files
        you want to include in the File Set. Each regular expression can be used to include or exclude files (the
        default regular expressions matches all files ending with &quot;.java&quot;). <br/> The regular expression is
        matched against the fully qualified file name within the project. <br/> That is, the entire path to the file
        starting with the name of the top level folder within the project and progressing through each folder down to
        the file, with &#39;/&#39; being used as the path separator. <br/> For example, consider the project in the
        figure below. The <span class="code-blue">CheckstylePlugin.java</span> file has a complete path of <b>
            <span class="code-blue">src/com/atlassw/tools/eclipse/checkstyle/CheckstylePlugin.java</span>
        </b></p>
    <p>
        <img src="images/package_tree.gif" alt="Package Explorer"/>
    </p>
    <p>The include/exclude setting of the <b>
            <i>last</i>
        </b> regular expression a file matches will determine if the file is included in or excluded from the File Set.
        <br/> This lets you create a regular expression that matches a number of files and then refine the selection
        with a series of exclusion expressions. <br/> To adjust the order of the regular expressions use the Up and Down
        buttons to move the selected expression up or down in the list. <br/> The bottom section of the Checkstyle File
        Set Editor shows which files from your project are included in your file set based on the current settings.
        <br/> This section will update as you change the regular expression patterns and their include/exclude
        state.</p>
    <p>Each project in your Eclipse workspace can have any number of File Sets defined, each with a different set of
        files and each with a different Check Configuration. <br/> You can also turn off the checking of a File Set
        using the Enabled check box in the properties window.</p>
</div>
